[Python SDK] Add resources field to Event, CreateEventRequest, and UpdateEventRequest models (CUST-5372)#480
Open
pengfeiye wants to merge 1 commit into
Conversation
…dateEventRequest models (CUST-5372)
AaronDDM
requested changes
Jul 10, 2026
AaronDDM
left a comment
Contributor
There was a problem hiding this comment.
Good morning!
The models, docstrings, and test coverage here are great — I especially like the edge cases (missing / empty / partial / multiple resources, plus the create/update passthrough).
One blocker before merge:
- No CHANGELOG.md entry. The
Unreleasedsection only has the existing "default visibility" line. Please add something like:
* Added resources field to Event, CreateEventRequest, and UpdateEventRequest models
Minor, non-blocking:
- The existing code uses separate
CreateParticipant/UpdateParticipanttypes, but you've reused a singleWritableResourcefor both create and update. Fine while the shapes are identical — just flagging in case they ever diverge.
Requesting changes only for the changelog; everything else looks good. Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for the
resourcesfield on events (used for room/resource booking) to the Python SDK, resolving CUST-5372 (child of CUST-5262). The Nylas API already supports this field; this change exposes it in the SDK models so resource data is deserialized from responses and can be sent on create/update requests.Changes
nylas/models/events.pyResourceresponse dataclass (@dataclass_json) with optional fields:email,name,capacity,building,floor_name,floor_section,floor_number.resources: Optional[List[Resource]]to theEventresponse model so resource data is deserialized from API responses.WritableResourceTypedDict(all keysNotRequired) for request bodies, following the existingParticipant/CreateParticipantpattern; reused across both request models since the create/update shape is identical.resources: NotRequired[List[WritableResource]]toCreateEventRequestandUpdateEventRequest.tests/resources/test_events.pytest_event_deserialization,test_create_event, andtest_update_eventto cover theresourcesfield.resources, empty list, partially-populated resource, multiple resources, and create/update request passthrough for empty/partial resources.Test plan
pytest tests/resources/test_events.py(28 passed)License
I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.